package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.DevicePageQueryDto;
import com.zzyl.entity.Device;
import com.zzyl.vo.DeviceVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface DeviceMapper {
    @Select("select count(1) from device where device_name = #{deviceName}")
    Integer queryByDeviceName(String deviceName);

    void insert(Device device);

    Page<DeviceVo> queryDevicePage(DevicePageQueryDto devicePageQueryDto);

    @Select("select * from device where iot_id =  #{iotId}")
    DeviceVo queryDeviceById(String iotId);
}
